var mongoose = require('mongoose');
var db = require('../index').db;
var autoIncrement = require('mongoose-auto-increment');
autoIncrement.initialize(db);

var Schema = new mongoose.Schema({
    id : {type: Number, index: true},
    arr: Array
});

Schema.plugin(autoIncrement.plugin,{
    model: 'ad',   //数据模块，需要跟同名 x.model("Books", BooksSchema);
    field: 'id',     //字段名
    startAt: 1,    //开始位置，自定义
    incrementBy: 1    //每次自增数量
});

module.exports = db.model('ad', Schema, 'ad');